<template>
    <div class="common-layout">
        <el-container>

            <el-aside width="200px">
                <el-col :span="12">
                    <el-menu :router="true" active-text-color="#ffd04b" background-color="#545c64"
                        class="el-menu-vertical-demo" default-active="2" text-color="#fff" @open="handleOpen"
                        @close="handleClose">
                        <el-sub-menu index="1">
                            <template #title>
                                <el-icon>
                                    <location />
                                </el-icon>
                                <span>
                                    商品
                                </span>
                            </template>
                            <el-menu-item index="/Querylist"> 商品列表 </el-menu-item>
                            <el-menu-item index="/ListWithPage">添加商品</el-menu-item>
                        </el-sub-menu>
                        <el-sub-menu index="2">
                            <template #title>
                                <span>轮播图的管理</span>
                            </template>
                            <el-menu-item index="/Admin/List"> 轮播图列表</el-menu-item>
                            <el-menu-item index="/Admin/Add">轮播图添加</el-menu-item>
                        </el-sub-menu>
                        <el-sub-menu index="3">
                            <template #title>
                                <span>操作人员管理</span>
                            </template>
                            <el-menu-item index="/AdminList"> 操作人员列表</el-menu-item>
                            <el-menu-item index="/AdminAdd">添加操作人员</el-menu-item>
                        </el-sub-menu>
                    </el-menu>
                </el-col>
            </el-aside>
            <el-container>
                <el-header>Header</el-header>
                <el-main>
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>
  
<script setup lang="ts">
import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
} from '@element-plus/icons-vue'
const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>
 
<style scoped>
.common-layout,
.el-container {
    width: 100%;
    height: 100%;
}

.el-aside {
    width: 200px;
    height: 100%;
    background-color: rgb(84, 92, 100);
}

.el-menu-vertical-demo {
    width: 200px;
}

.el-header {
    width: 100%;
    height: 120px;
    background-color: rgb(100, 207, 249);
}
</style>